<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('members', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('phone')->unique();
            $table->string('nickname')->nullable();
            $table->string('openid')->nullable();
            $table->decimal('money')->default(0);
            $table->decimal('give_money')->default(0)->comment('总赠送金额');
            $table->decimal('all_consumption')->default(0)->comment('总消费 元');
            $table->decimal('all_recharge')->default(0)->comment('总充值 元');
            $table->decimal('all_sparring_consumption')->default(0)->comment('助教消费 元');
            $table->string('avatar')->comment("头像")->nullable();
            $table->string("assistant_status")->default(\App\Enums\AssistantStatus::NotOnDuty->value)->comment("点助教的状态");
            $table->string("sex")->nullable()->comment("性别");
            $table->string('member_level')->comment("累计会员等级ID");
            $table->string('member_month_level')->comment("月度会员等级ID");
//            $table->string('type')->comment("会员类型")->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('members');
    }
};
